package init;

import model.Dishes;
import model.User;

import java.io.BufferedReader;

import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;

public class DishesInit {
    public static ArrayList<Dishes> dishes = new ArrayList<>();
    public DishesInit() throws IOException{
        BufferedReader bufferedReader = new BufferedReader(new FileReader("dishes.txt"));
        String data = null;
        while((data = bufferedReader.readLine())!=null){
            String[] split = data.split(",");
            String s0 = split[0];
            String s1 = split[1];
            String s2 = split[2];
            String s3 = split[3];
            String s4 = split[4];
            String s5 = split[5];
            Dishes dishes1 = new Dishes(Long.valueOf(s0),s1,s2,Integer.valueOf(s3),Integer.valueOf(s4),Double.valueOf(s5));
            dishes.add(dishes1);
        }
    }
}
